<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head(title)">
    <meta charset="UTF-8">
    <!--移动端更好的适应-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title th:replace="${title}">公共片段</title>
    <link rel="stylesheet" href="../static/dist/semantic/semantic.min.css" th:href="@{/dist/semantic/semantic.min.css}">
    <link rel="stylesheet" href="../static/css/my.css" th:href="@{/css/my.css}">
    <link rel="stylesheet" href="../static/css/typo.css" th:href="@{/css/typo.css}">
    <link rel="stylesheet" href="../static/css/animate.css" th:href="@{/css/animate.css}">
    <link rel="stylesheet" href="../static/lib/prism/prism.css" th:href="@{/lib/prism/prism.css}">
    <link rel="stylesheet" href="../static/lib/tocbot/tocbot.css" th:href="@{/lib/tocbot/tocbot.css}">
</head>
<body>
<!--    导航-->
<nav th:fragment="menu(n)" class="ui segment inverted attached m-padded-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">ZBlog</h2>
            <a th:href="@{/}" href="#" class="m-item item m-mobile-hide " th:classappend="${n == 1} ? 'active'"><i class="home icon"></i>首页</a>
            <a th:href="@{/type/-1}" href="#" class="m-item item m-mobile-hide " th:classappend="${n == 2} ? 'active'"><i class="idea icon"></i>分类</a>
            <a th:href="@{/tag/-1}" href="#" class="m-item item m-mobile-hide " th:classappend="${n == 3} ? 'active'"><i class="tags icon"></i>标签</a>
            <a th:href="@{/archives}" href="#" class="m-item item m-mobile-hide " th:classappend="${n == 4} ? 'active'"><i class="clone icon"></i>归档</a>
            <a th:href="@{/about}" href="#" class="m-item item m-mobile-hide " th:classappend="${n == 5} ? 'active'"><i class="info icon"></i>关于我</a>
            <div class="m-item right item m-mobile-hide">
                <form th:action="@{/search}" name="search" target="_self" method="post">
                    <div class="ui inverted transparent icon input">
                        <input type="text" name="query" placeholder="搜索..." th:value="${query}">
                        <i onclick="document.forms['search'].submit()" class="search icon link"></i>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <a href="#" class="ui m-menu m-toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>

<!--    页脚-->
<footer th:fragment="footer" class="ui inverted segment  vertical m-padded-large">
    <div class="ui container center aligned">
        <div class="ui inverted stackable grid divided">
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../static/images/wechat.jpg" th:src="@{/images/wechat.jpg}" class="ui rounded image" alt="亚里士多得"
                             style="width: 100px">
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted">最新博客</h4>
                <div id="new-blog-container">
                    <div class="ui inverted link list" th:fragment="newBlogList">
                        <a href="#" class="item" th:each="blog : ${newBlogs}"
                           th:href="@{/blog/{id}(id=${blog.id})}" th:text="${blog.title}">博客1</a>
                        <!--/*-->
                        <a href="#" class="item">博客1</a>
                        <a href="#" class="item">博客1</a>
                        <a href="#" class="item">博客1</a>
                        <!--*/-->
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted">联系我</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item" th:text="#{footer.qq}">QQ:3402747477</a>
                    <a href="#" class="item" th:text="#{footer.email}">邮箱:3402747477@qq.com</a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted">介绍</h4>
                <div class="ui inverted link list">
                    <p class="m-opacity-mini" th:text="#{footer.introduce}">
                        这是我的个人博客、会分享关于编程、写作、思考相关的任何内容，希望可以给来到这儿的人有所帮助
                    </p>
                </div>
            </div>
        </div>
        <!--    分隔符-->
        <div class="ui inverted section divider"></div>
        <div class="m-text-thin m-text-spaced m-opacity-mini" th:text="#{footer.copyright}">
            Copyright 2023-now ZBlog Designed by dylan
        </div>
    </div>
</footer>

<!--    js-->
<th:block th:fragment="script" th:inline="javascript">
    <script rel="script" src="../static/dist/jquery/jquery-3.4.1.min.js"  th:src="@{/dist/jquery/jquery-3.4.1.min.js}"></script>
    <script rel="script" src="../static/dist/semantic/semantic.js" th:src="@{/dist/semantic/semantic.js}"></script>
    <script rel="script" src="../static/lib/prism/prism.js" th:src="@{/lib/prism/prism.js}"></script>
    <script rel="script" src="../static/lib/tocbot/tocbot.js" th:src="@{/lib/tocbot/tocbot.js}"></script>
    <script rel="script" src="../static/lib/qrcode/qrcode.js" th:src="@{/lib/qrcode/qrcode.js}"></script>

    <script src="../static/lib/scrollTo/scrollTo.min.js" th:src="@{/lib/scrollTo/scrollTo.min.js}"></script>
    <script src="../static/lib/waypoints/waypoints.js" th:src="@{/lib/waypoints/waypoints.js}"></script>
    <script>
        $("#new-blog-container").load(/*[[@{/footer/newBlog}]]*/'');
    </script>
</th:block>
</body>
</html>